﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Employee_save.aspx.cs"
    Inherits="TRPOP.CRM.Web.Employee_save" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>编辑员工信息</title>
    <script src="../Scripts/CheckInputInfo.js" type="text/javascript"></script>
    <script src="../Scripts/showtab.js" type="text/javascript"></script>
    <script src="../Scripts/utils.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.js" type="text/javascript"></script>
    <script src="../Scripts/iColorPicker.js" type="text/javascript"></script>
    <script src="../Scripts/Information_save.js" type="text/javascript"></script>
    <script src="../Scripts/City.js" type="text/javascript"></script>
    <script type="text/javascript">
        function checkInfo() {
            //判断员工编号是否为空
            empNum = document.getElementById("txtEmployeeNum");
            if (trim(empNum.value).length <= 0) {
                alert("请输入员工编号");
                empNum.focus();
                return false;
            }
            else if (!IsEnKongCheck(empNum.value)) {
                alert("输入员工编号格式不正确");
                return false;
            }

            //判断员工姓名
            empName = document.getElementById("txtEmployeeName");
            if (trim(empName.value).length <= 0) {
                alert("请输入员工姓名");
                empName.focus();
                return false;
            }

            //判断密码
            empPwd = document.getElementById("txtPwd");
            empConfirmPwd = document.getElementById("txtConfirmPwd");
            if (trim(empPwd.value).length > 0 && trim(empPwd.value) != trim(empConfirmPwd.value)) {
                alert("两次密码输入不一致，请重新重新输入");
                empConfirmPwd.focus();
                return false;
            }

            //判断入职时间
            empStartTime = document.getElementById("txtStartTime");
            if (trim(empStartTime.value).length <= 0) {
                alert("请输入员工入职时间");
                empStartTime.focus();
                return false;
            }

            //判断电话是否为空
            phone = document.getElementById("txtMobile");
            if (trim(phone.value).length <= 0) {
                ShowTab(2);
                alert("请输入手机号码");
                phone.focus();
                return false;
            } else if (!IsPhoneCheck(phone.value)) {
                ShowTab(2);
                alert("输入手机号码格式不正确");
                //phone.focus();
                return false;
            }

            //判断email是否为空
            email = document.getElementById("txtEmail");
            if (trim(email.value).length > 0 && !IsEMailCheck(email.value)) {
                ShowTab(2);
                alert("输入Email格式不正确");
                return false;
            }

            $("#txtProvince").val($("#DDLProvince option:selected").text());

            $("#txtCity").val($("#DDLCity option:selected").text());

            return true;
        }

        //根据阳历日期，取得阴历日期
        function getLunarDay() {
            strbithday = document.getElementById("txtBirthday");
            if (strbithday.value.length < 8) {
                return "";
            }
            stryear = strbithday.value.substring(0, 4);
            strmonth = strbithday.value.substring(5, 7);
            strday = strbithday.value.substring(8, 10);

            strreturn = GetLunarDay(stryear, strmonth, strday)

            lunarday = document.getElementById("txtLunarDay");

            lunarday.value = strreturn;


        }
    </script>
    <style type="text/css">
        #dvImg
        {
            filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);
            width: 125px;
            height: 125px;
            border: solid 1px #a4c9e2;
            float: left;
        }
    </style>
</head>
<body>
    <form id="formEdit" runat="server" onsubmit="return CheckForm(this)">
    <div class="welcomBox">
        <div class=" welcomCont listPadding">
            <p class=" mb5 c_grey postion">
                您的当前位置：<a href="../welcome.aspx" title="首页">首页</a> > <a href="Employee_list.aspx"
                    title="信息管理">信息管理</a> > <span title="信息">信息</span></p>
            <h4 class="f14 listTits">
                <a href="#" class="js_on" id="Tab1" onclick="ShowTab(1)" title="信息浏览权限" runat="server">
                    基础信息</a> <a class="" href="#" id="Tab2" onclick="ShowTab(2)" title="信息管理权限">联系方式</a>
            </h4>
            <div class="listCon contentPadding">
                <div id="box1" style="display: block; height: 590px;" runat="server">
                    <table width="100%" border="0" class="f14 tableForm">
                        <tr>
                            <td>
                                <table width="100%" border="0" class="basicmaterial">
                                    <tr>
                                        <td width="20%" class="tr pr10">
                                            <span>员工照片：</span>
                                        </td>
                                        <td>
                                            <div class="editright">
                                                <div class="photo">
                                                    <div id="dvImg" runat="server">
                                                    </div>
                                                </div>
                                                <div class="cb">
                                                </div>
                                                <p>
                                                    <asp:FileUpload ID="fuEmployeeImage" runat="server" CssClass="uploadp" />
                                                </p>
                                                <p>
                                                    支持jpg、gif、png格式的图片，不超过2M; 建议图片尺寸大于180X180</p>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" class="tr pr10">
                                            <span>员工状态：</span>
                                        </td>
                                        <td colspan="3">
                                            <asp:DropDownList ID="ddlEmployeeStatus" CssClass="searchddl" runat="server">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" class="tr pr10">
                                            <span>所属系统角色：</span>
                                        </td>
                                        <td colspan="3">
                                            <asp:DropDownList ID="ddlSystemRole" CssClass="searchddl" runat="server">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" class="tr pr10">
                                            <span>员工编号：</span>
                                        </td>
                                        <td colspan="3" class="style2">
                                            <asp:TextBox ID="txtEmployeeNum" CssClass="nameIpt" runat="server" MaxLength="10"
                                                onfocus="changePromptInfo(lblEmInfo)" onblur="IsEnKong(this.value, lblEmInfo,'请输入员工编号')"
                                                Height="19px" Width="135px"></asp:TextBox>
                                            <font style="color: Red">*</font>
                                            <asp:Label ID="lblEmInfo" runat="server" Text=""></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" class="tr pr10">
                                            <span>员工姓名：</span>
                                        </td>
                                        <td colspan="3">
                                            <asp:TextBox ID="txtEmployeeName" CssClass="nameIpt" runat="server" Width="135px"
                                                onfocus="changePromptInfo(lblNamePrompt)" MaxLength="16" onblur="requireValue(this.value, lblNamePrompt,'请输入员工姓名')"
                                                Height="19px"></asp:TextBox>
                                            <font style="color: Red">*</font>
                                            <asp:Label ID="lblNamePrompt" runat="server" Text=""></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" class="tr pr10">
                                            <span>密码：</span>
                                        </td>
                                        <td colspan="3">
                                            <asp:TextBox ID="txtPwd" CssClass="nameIpt" runat="server" Width="135px" Height="19px"
                                                TextMode="Password"></asp:TextBox>
                                            <font style="color: Red">默认密码:123456</font>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" class="tr pr10">
                                            <span>确认密码：</span>
                                        </td>
                                        <td colspan="3">
                                            <asp:TextBox ID="txtConfirmPwd" CssClass="nameIpt" runat="server" Width="135px" Height="19px"
                                                TextMode="Password"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" class="tr pr10">
                                            <span>性别:</span>
                                        </td>
                                        <td colspan="3">
                                            <asp:RadioButtonList ID="rbtnlstGender" runat="server" RepeatDirection="Horizontal"
                                                Height="16px" Width="95px">
                                                <asp:ListItem Selected="True" Text="男" Value="1"></asp:ListItem>
                                                <asp:ListItem Text="女" Value="0"></asp:ListItem>
                                            </asp:RadioButtonList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" class="tr pr10">
                                            <span>出生日期：</span>
                                        </td>
                                        <td colspan="3">
                                            <asp:TextBox ID="txtBirthday" runat="server" Width="135px" ToolTip="格式：2011-01-01"
                                                onclick="javascript:return new Calendar.display(this.id,event);" Height="19px"
                                                CssClass="nameIpt"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" class="tr pr10">
                                            <span>所过生日类型：</span>
                                        </td>
                                        <td>
                                            <asp:RadioButtonList ID="rbtnIsSolarBirthday" RepeatDirection="Horizontal" runat="server"
                                                Height="16px" Width="95px">
                                                <asp:ListItem Text="农历" Value="0"></asp:ListItem>
                                                <asp:ListItem Text="阳历" Value="1" Selected="True"></asp:ListItem>
                                            </asp:RadioButtonList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" class="tr pr10">
                                            <span>入职时间：</span>
                                        </td>
                                        <td colspan="3">
                                            <asp:TextBox ID="txtStartTime" runat="server" Width="135px" ToolTip="格式：2011-01-01"
                                                onclick="javascript:return new Calendar.display(this.id,event);" Height="19px"
                                                CssClass="nameIpt"></asp:TextBox>
                                            <font style="color: Red">*</font><asp:Label ID="lblStartTime" runat="server" Text=""></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" class="tr pr10">
                                            <span>所属部门：</span>
                                        </td>
                                        <td colspan="3" class="style1">
                                            <asp:DropDownList ID="ddlDepartment" CssClass="searchddl" runat="server" Height="19px"
                                                Width="135px">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" class="tr pr10">
                                            <span>职位：</span>
                                        </td>
                                        <td colspan="3">
                                            <asp:DropDownList ID="ddlJobTitle" CssClass="searchddl" runat="server" Height="19px"
                                                Width="135px">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="box2" style="height: 590px;">
                    <table width="100%" border="0" class="f14 tableForm">
                        <tr>
                            <td width="20%" class="tr pr10">
                                <span>手机号码：</span>
                            </td>
                            <td>
                                <asp:TextBox ID="txtMobile" runat="server" CssClass="nameIpt" MaxLength="15" Width="200px"
                                    onfocus="changePromptInfo(lblMobile)" onblur="IsPhone(this.value, lblMobile,'请输入手机号码')"></asp:TextBox>
                                <font style="color: Red">*</font>
                                <asp:Label ID="lblMobile" runat="server" Text=""></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" class="tr pr10">
                                <span>Email：</span>
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtEmail" runat="server" CssClass="nameIpt" MaxLength="45" Width="200px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" class="tr pr10">
                                <span>邮编：</span>
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtPostalCode" CssClass="nameIpt" runat="server" MaxLength="10"
                                    Width="200px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" class="tr pr10">
                                <span>国家： </span>
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtCountry" Text="中国" runat="server" Visible="false" MaxLength="45"
                                    Width="200px" CssClass="nameIpt"></asp:TextBox>
                                <asp:DropDownList ID="ddlCountry" CssClass="searchddl" runat="server">
                                    <asp:ListItem>中国</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" class="tr pr10">
                                <span>省份： </span>
                            </td>
                            <td colspan="3" class="style1">
                                <select id="DDLProvince" class="searchddl" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" class="tr pr10">
                                <span>城市： </span>
                            </td>
                            <td colspan="3">
                                <select id="DDLCity" class="searchddl" runat="server" />
                                <asp:HiddenField ID="txtProvince" Value="全国" runat="server" />
                                <asp:HiddenField ID="txtCity" Value="所有地区" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" class="tr pr10">
                                <span>街道：</span>
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtStreet" runat="server" MaxLength="45" Width="200px" CssClass="nameIpt"></asp:TextBox>
                            </td>
                        </tr>
                        <tr style="display: none;">
                            <td width="20%" class="tr pr10">
                                <span>街道1：</span>
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtStreet1" runat="server" MaxLength="45" Width="200px" CssClass="nameIpt"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" class="tr pr10">
                                <span>联系人： </span>
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtEmergencyContactName" CssClass="nameIpt" runat="server" MaxLength="45"
                                    Width="200px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" class="tr pr10">
                                <span>联系电话2： </span>
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtEmergencyContactPhone1" CssClass="nameIpt" runat="server" MaxLength="15"
                                    Width="200px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" class="tr pr10">
                                <span>联系电话2：</span>
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtEmergencyContactPhone2" CssClass="nameIpt" runat="server" MaxLength="15"
                                    Width="200px"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </div>
                <table width="100%" border="0" class="f14 tableForm">
                    <tr>
                        <td width="27%">
                            &nbsp;
                        </td>
                        <td>
                            <asp:Button ID="btnSave" CssClass="mr50 okBtn" runat="server" Text="保存" OnClick="btnSave_Click"
                                OnClientClick="return checkInfo();" />&nbsp;
                            <input type="reset" name="BtnReset" class="  mr50 canelBtn" value="重置" />&nbsp;<input
                                type="button" class=" canelBtn" value="取消" onclick="window.location.href='Employee_list.aspx';" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    </form>
    <script type="text/javascript">
        InitCitySelect();
    </script>
</body>
</html>
